/*package com.dp.service.impl3;

import java.util.List;

import javax.persistence.Query;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dp.vo.NewsCatlog;
import com.dp.vo.NewsCatlogPlatform;
import com.dp.vo.NewsCatlogPlatformPK;



@Service
@Transactional
public class CatlogplatformServiceImpl3 extends BaseServiceImpl3{
	*//**
	 * 得到客户端平台信息记录数
	 * @return 
	 *//*
	public Long findCatlogPlatformCount() 
	{
		String hql = "SELECT count(newsCatlogPlatformPK.mplatform) FROM NewsCatlogPlatform n where 1=1 ";
		Object obj = getSingleResult(hql);
		if(obj ==null ){
			return Long.valueOf(0+"");
		}else{
			return (Long) obj;
		}
	}
	*//**
	 * 得到客户端平台信息记录,分页
	 * @return
	 *//*
	public List<NewsCatlogPlatform> findAllCatlogPlatform(NewsCatlogPlatform catlogPlatform,int firstrow, int maxrow) 
	{
		StringBuffer sf = new StringBuffer("SELECT n FROM NewsCatlogPlatform n where 1=1");	
    	if(catlogPlatform!=null&&catlogPlatform.getNewsCatlogPlatformPK()!=null){
	    	if(catlogPlatform.getNewsCatlogPlatformPK().getMplatform().trim().length()>0){
			    sf.append(" and newsCatlogPlatformPK.mplatform like '%"+catlogPlatform.getNewsCatlogPlatformPK().getMplatform()+"%'");
	    	}if(catlogPlatform.getNewsCatlogPlatformPK().getMagent().trim().length()>0){
			    sf.append(" and newsCatlogPlatformPK.magent like '%"+catlogPlatform.getNewsCatlogPlatformPK().getMagent()+"%'");
		    }if(catlogPlatform.getNewsCatlogPlatformPK().getMserialnum().trim().length()>0){
			    sf.append(" and newsCatlogPlatformPK.mserialnum  like '%"+catlogPlatform.getNewsCatlogPlatformPK().getMserialnum()+"%'");
		    }
    	}
		return getQueryList(sf.toString(), firstrow, maxrow);
	}
	
	*//**
	 * 根据复合主键得到catlogPlatform
	 * @param newsCatlogPlatformPK
	 * @return
	 *//*
	public NewsCatlogPlatform getCatlogPlatformByKeys(
			NewsCatlogPlatformPK newsCatlogPlatformPK) {
		StringBuffer sf = new StringBuffer("SELECT n FROM NewsCatlogPlatform n where 1=1");
		sf.append(" and n.newsCatlogPlatformPK.mplatform='"+ newsCatlogPlatformPK.getMplatform()+"'");
		sf.append(" and n.newsCatlogPlatformPK.magent='"+ newsCatlogPlatformPK.getMagent()+"'");
		sf.append(" and n.newsCatlogPlatformPK.mserialnum='"+ newsCatlogPlatformPK.getMserialnum()+"'");
		sf.append(" and n.newsCatlogPlatformPK.mlocale='"+ newsCatlogPlatformPK.getMlocale()+"'");
		Object obj = getSingleResult(sf.toString());
		if(obj ==null ){
			return null;
		}else{
			return (NewsCatlogPlatform) obj;
		}
	}
	*//**
	 * 得到默认Catlog
	 * @param newsCatlog
	 * @return
	 *//*
	public NewsCatlog getDefaultCatlog() {
		String hql = "SELECT n FROM NewsCatlog n where 1=1 and n.isnowpublish=1";
		Object obj = getSingleResult(hql);
		if(obj ==null ){
			return null;
		}else{
			return (NewsCatlog) obj;
		}
	}
	*//**
	 *  判断catlog是否关联platform
	 * @param catalogid
	 * @return
	 *//*
	public boolean isAssociatedPlatform(int catalogid) {
		StringBuffer sf = new StringBuffer("SELECT n FROM NewsCatlogPlatform n where 1=1");
		sf.append(" and n.catlogid.catlogid='"+ catalogid+"'");
		List<NewsCatlogPlatform> list=getQueryList(sf.toString());
		if(list.size()>0){
			return true;
		}else{
			return false;
		}
	}
	*//**
	 * 设置当前(默认,下线）目录关联的平台catlogid为null
	 * @param catalogid
	 *//*
	public void updateCurrentCatlogPlatform(int catalogid) {
		StringBuffer sf = new StringBuffer("update NewsCatlogPlatform n set n.catlogid=null where 1=1");
		sf.append(" and n.catlogid.catlogid='"+ catalogid+"'");
		updateHql(sf.toString());
	}
	public int updateCatlogPlatform(NewsCatlogPlatform catlogPlatform2,NewsCatlogPlatform catlogPlatform) {
		// TODO Auto-generated method stub
		int iCode=0;
		StringBuffer sf = new StringBuffer("update NewsCatlogPlatform n set " +
				"n.newsCatlogPlatformPK.mplatform='"+catlogPlatform2.getNewsCatlogPlatformPK().getMplatform()+"'," +
				"n.newsCatlogPlatformPK.magent='"+catlogPlatform2.getNewsCatlogPlatformPK().getMagent()+"'," +
				"n.newsCatlogPlatformPK.mserialnum='"+catlogPlatform2.getNewsCatlogPlatformPK().getMserialnum()+"'," +
				"n.newsCatlogPlatformPK.mlocale='"+catlogPlatform2.getNewsCatlogPlatformPK().getMlocale()+"'," +
				" n.catlogid.catlogid="+catlogPlatform2.getCatlogid().getCatlogid()+" where 1=1");
		sf.append(" and n.newsCatlogPlatformPK.mplatform='"+catlogPlatform.getNewsCatlogPlatformPK().getMplatform()+"'" +
				" and n.newsCatlogPlatformPK.magent='"+catlogPlatform.getNewsCatlogPlatformPK().getMagent()+"'" +
				" and n.newsCatlogPlatformPK.mserialnum='"+catlogPlatform.getNewsCatlogPlatformPK().getMserialnum()+"'" +
				"  and n.newsCatlogPlatformPK.mlocale='"+catlogPlatform.getNewsCatlogPlatformPK().getMlocale()+"'");
	  try {
		  iCode=updateHql(sf.toString());
	  } catch (Exception e) {
		// TODO: handle exception
		  e.printStackTrace();
	  }
		return iCode;
	}
	
	@SuppressWarnings("unchecked")
	public int updateHql(String hql) {
		Query query = emr.createQuery(hql);
		int iCode=0;
		iCode=query.executeUpdate();
		emr.flush();
		return iCode;
	}
}
*/